package com.stan.core.spark.ad.blackList.functions;

import org.apache.spark.api.java.function.PairFunction;
import scala.Serializable;
import scala.Tuple2;

public class StreamToUserId2DataRDDFunction implements
        PairFunction<Tuple2<String, String>, String, String>, Serializable {
    @Override
    public Tuple2<String, String> call(
            Tuple2<String, String> stringStringTuple2) throws Exception {
        String adData = stringStringTuple2._2;
        String[] splited = adData.split(" ");
        String userId = splited[4];
        return new Tuple2<String, String>(userId,adData);
    }
}
